<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head> <% if (session.getAttribute("ingelogd")==null || session.getAttribute("ingelogd").equals("nee")){   response.sendRedirect("login.jsp"); } %>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
      <!--
      a {color: white;  font-weight: bold;} body,td,th {
        font-family: Geneva, Arial, Helvetica, sans-serif;
        font-size: small;
        color: #FFFFFF;
      }
      body {
        background-color: #3d5b9e;
      }
      -->
  </style>

  <script type="text/javascript">
      <!--
      function confirmation(nr) {
        var answer = confirm("Weet u zeker dat u dat wilt verwijderen ?")
        if (answer){
          window.location = "Pinautomaat delete.jsp?a="+nr;
        }
      }
      //-->
    </script>

  </head>

  <body>
    <h3>Overzicht van de Geldbiljetten in de Pinautomaten</h3>
    <%
   String[] kolommen = {"Pinautomaat", "Aantal5", "Aantal10", "Aantal20", "Aantal50", "Aantal100", "Aantal200", "Aantal500", "AanUit", "Vul", "Del"};
   String tabelNaam = "b_biljetten";
   out.println("<table border=\"1\">\n<tr>\n<td>&nbsp;\n");
   for (int i = 0; i <= kolommen.length - 1; i++) {
     out.println("<td>" + kolommen[i] + "\n");
   }
   out.println("</tr>\n");
   eskuel.CMI_SQL sql = new eskuel.CMI_SQL(pak.Db.dbhost, pak.Db.dbname, pak.Db.dbpass);
   java.sql.ResultSet res = sql.selectieQuery("SELECT * FROM cmi0806683." + tabelNaam);
   int a = 1;
   while (res.next()) {
     out.println("<tr><td>" + a + "\n");
     a++;
     for (int j = 1; j <= kolommen.length; j++) {
       if (j == kolommen.length - 1) {
         //Vul
         out.println("<td><a href=\"BiljettenVullen.jsp?a="+res.getString("Pinautomaat")+"\">KLIK</a>");
       } else if (j == kolommen.length) {
         //Del
         out.println("<td><a href=\"#\" onclick=\"confirmation("+res.getString("Pinautomaat")+")\">KLIK</a>");
       } else {
         out.println("<td>" + res.getString(j));
       }
     }
   }
    %>
  </body>
</html>
